<%@ page import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key="zhyyglhtxt"/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>

<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <div class="layui-tab-content" style="height: 100%;">
        <div class="layui-tab-item layui-show">
            <div class="layui-container">
                <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label"><span style="color: red;">*</span><fmt:message key="nrms"/></label>
                        <div class="layui-input-inline" style="width: 70%">
                            <div id="content" style="height:400px; width: 100%;"></div>
                            <input type="hidden" id="aboutusContent" value='${aboutUs.content}'/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="" class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="button" value="<fmt:message key='queding'/>" id="submit" class="layui-btn">
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript" src="${web_domain}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${web_domain}/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="${web_domain}/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>

    var tool = {
        toolbars: [
            [
                'preview', //预览
                'undo', //撤销
                'redo', //重做
                'bold', //加粗
                'indent', //首行缩进
                'italic', //斜体
                'underline', //下划线
                'strikethrough', //删除线
                'subscript', //下标
                'fontborder', //字符边框
                'superscript', //上标
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'horizontal', //分隔线
                'removeformat', //清除格式
                'cleardoc', //清空文档
                'fontfamily', //字体
                'paragraph', //段落格式
                'simpleupload', //单图上传
                'insertimage', //多图上传
                'edittable', //表格属性
                'edittd', //单元格属性
                'emotion', //表情
                'forecolor', //字体颜色
                'insertorderedlist', //有序列表
                'insertunorderedlist', //无序列表
                'fullscreen', //全屏
                'rowspacingtop', //段前距
                'rowspacingbottom', //段后距
                'lineheight', //行间距
                'edittip ', //编辑提示
                'autotypeset', //自动排版
                'inserttable', //插入表格
                'source' //源代码
            ]
        ]
    };

    UE.getEditor('content', tool);
    var content = UE.getEditor('content');

    content.addListener("ready", function () {
        UE.getEditor('content').setContent($("#aboutusContent").val());
    });


    layui.use(['form'], function () {
        var form = layui.form;

        $("#submit").click(function () {
            if (!content.getContent()) {
                layer.msg("<fmt:message key='qsrjsnr'/>");
                return;
            }

            feijin.put({
                url: "${web_domain}/mall/aboutus/modify",
                data: {"content": content.getContent()}
            });

        });
    });
</script>
</body>
</fmt:bundle>
</html>